<template>
  <div class="app-container">
    <el-form ref="form" :model="form" :rules="rules">
    <el-row :gutter="20">
      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>紧急出库设置</span>
          </div>
          <div class="body">
              <el-form-item prop="beiStarttime" label="开始时间点" label-width="90px">
                  <el-time-picker
                    v-model="form.beiStarttime"
                    placeholder="开始时间点"
                    format="HH:mm"
                    editable
                    clearable
                    value-format="HH:mm">
                  </el-time-picker>
              </el-form-item>
            <el-form-item prop="beiEndtime" label="结束时间点"  label-width="90px">
              <el-time-picker
                v-model="form.beiEndtime"
                placeholder="结束时间点"
                format="HH:mm"
                editable
                clearable
                value-format="HH:mm">
              </el-time-picker>
            </el-form-item>

          </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>***</span>
          </div>
          <div class="body" >
          </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>***</span>
          </div>
          <div class="body">


          </div>
        </el-card>
      </el-col>
    </el-row>
    <el-divider/>
    </el-form>
    <el-button type="primary" @click="submitForm">提交</el-button>
  </div>
</template>

<script>
  import {getUrgenttime,  addUrgenttime, updateUrgenttime } from "@/api/sparepart/urgenttime";
export default {
  name: "Urgenttime",
  components: {
  },
  data() {
    return {
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询紧急出库时间设置列表 */
    getList() {
      getUrgenttime(1).then(response => {
        this.form = response.data;
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.beiId != null) {
            updateUrgenttime(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.getList();
            });
          } else {
            addUrgenttime(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.getList();
            });
          }
        }
      });
    },
  }
};
</script>
<style scoped lang="scss">
  .body {
    height: 300px;
  }
  .home {
    blockquote {
      padding: 10px 20px;
      margin: 0 0 20px;
      font-size: 17.5px;
      border-left: 5px solid #eee;
    }

    hr {
      margin-top: 20px;
      margin-bottom: 20px;
      border: 0;
      border-top: 1px solid #eee;
    }

    .col-item {
      margin-bottom: 20px;
    }

    ul {
      padding: 0;
      margin: 0;
    }

    font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #676a6c;
    overflow-x: hidden;

    ul {
      list-style-type: none;
    }

    h4 {
      margin-top: 0px;
    }

    h2 {
      margin-top: 10px;
      font-size: 26px;
      font-weight: 100;
    }

    p {
      margin-top: 10px;

      b {
        font-weight: 700;
      }
    }

    .update-log {
      ol {
        display: block;
        list-style-type: decimal;
        margin-block-start: 1em;
        margin-block-end: 1em;
        margin-inline-start: 0;
        margin-inline-end: 0;
        padding-inline-start: 40px;
      }
    }
  }
</style>
